#pragma once
#include "DXAMLCommon.h"
#include "MonitorBuffer.h"
#include "ICallingMethod.h"
#include "IXcpTraceMessageSink.h"
#include "ITracingService.h"
#include "IPALReader.h"
#include "IPALMediaLayerTrace.h"
#include "IPALSurface.h"
#include "IThreadMonitor.h"


class IPALDebuggingServices
{
public:
	virtual void *               XcpDebugAllocate( XUINT32 cSize, DebugAllocationClass allocationClass) = 0;
	virtual void *               XcpDebugResize( void *pAddress, XUINT32 cSize, DebugAllocationClass allocationClass) = 0;
	virtual void                 XcpDebugFree( void *pAddress, DebugAllocationClass allocationClass) = 0;
	virtual HRESULT              XcpCheckLeaks( XINT32 fSilent) = 0;
	virtual void                 XcpTrackAddRefRelease( void *pAddress, XUINT32 cRef) = 0;
	virtual void                 XcpDebugSetLeakDetectionFlag( void *pAddress, XINT32 fDisableLeakDetection) = 0;
	virtual XUINT32              XcpVTrace( XUINT32 uClass, const XCHAR * pFilename, XINT32 iLine, XINT32 iValue, const XCHAR * pTestString, const XCHAR * pMessageString, void *pVArgs) = 0;
	virtual XUINT32              XcpTrace(XUINT32 uClass, const XCHAR * pFilename, XINT32 iLine, XINT32 iValue, const XCHAR * pTestString, const XCHAR * pMessageString,...) = 0;
	virtual void                 YieldSlice() = 0;
	virtual HRESULT              GetMonitorBuffer( MonitorBuffer **ppMonitorBuffer) = 0;
	virtual IThreadMonitor *     GetThreadMonitor() = 0;
	virtual HRESULT              ReleaseMonitorBuffer( MonitorBuffer *pMonitorBuffer) = 0;
	virtual void                 InitializeThreadMonitoring() = 0;
	virtual void                 DeleteThreadMonitoring() = 0;
	virtual XINT32               StringCchVPrintf(XCHAR * pString, XUINT32 cString, const XCHAR * pFormat, char * pVArgs) = 0;
	virtual XINT32               StringCchVPrintfA(char * pString, XUINT32 cString, const char * pFormat, char * pVArgs) = 0;
	virtual XINT32               YesNoMessageBox( XCHAR * pContent, const XCHAR * pTitle) = 0;
	virtual void                 XcpEnterSection( XUINT16 id) = 0;
	virtual void                 XcpLeaveSection( XUINT16 id) = 0;
	virtual void                 XcpPopToMark() = 0;
	virtual HRESULT              XcpTraceMonitorInitialize( XBYTE testMode) = 0;
	virtual void                 XcpTraceMonitorShutdown() = 0;
	virtual XINT32               XcpTraceMonitorAttached() = 0;
	virtual HRESULT              CaptureStack( XUINT32 cMaxCallers, XUINT32 *pcCallers, XUINT64 **ppCallers, XUINT32 cIgnoreLevels) = 0;
	virtual HRESULT              GetCallerSourceLocations( XUINT32 cCallers, XUINT64 *pCallers, ICallingMethod **ppCallingMethods) = 0;
	virtual void                 FreeCallingMethods( ICallingMethod *pCallers) = 0;
	virtual void                 BlockMemoryTrace( XINT32 bDisable) = 0;
	virtual void                 SetTraceMessageSink( IXcpTraceMessageSink *pTraceSink) = 0;
	virtual HRESULT              GetTraceMessageSink( IXcpTraceMessageSink **ppTraceSink) = 0;
	virtual HRESULT              XcpPerfMarker( XUINT64 lMarker) = 0;
	virtual HRESULT              XcpPerfMarkerStringInfo( XUINT64 lMarker, XCHAR * szMarkerInfo) = 0;
	virtual HRESULT              XcpPerfMarkerDwordInfo( XUINT64 lMarker, XCHAR * nMarkerInfo) = 0;
	virtual _PerfMarkerType      PerfMarkersEnabled() = 0;
	virtual HRESULT              XcpRenderCountersInitialize() = 0;
	virtual HRESULT              XcpRenderCountersIncrement( XUINT32 uCounter) = 0;
	virtual HRESULT              DebugOutputSzNoEndl(const XCHAR * pFormattedMsg,...) = 0;
	virtual void                 DebugOutputSz( const XCHAR * pMessage) = 0;
	virtual XUINT32              DebugAssertMessageBox( const XCHAR * pCondition, const XCHAR * pFile, XUINT32 nLine) = 0;
	virtual void                 DebugBreak() = 0;
	virtual unsigned char        TESTSignalMemLeak() = 0;
	virtual void                 TESTSignalManagedMemLeak( XUINT32 *showAssert) = 0;
	virtual void                 TESTSignalASSERT( const XCHAR * pString) = 0;
	virtual void                 TESTSignalReferenceTrackerLeak() = 0;
	virtual void                 FreeStackTrace( void *pCallers) = 0;
	virtual HRESULT              IsDebuggerAttached(XBOOL *pfDebuggerAtached) = 0;
	virtual void                 SetTraceFlags(XUINT32 *pFlags) = 0;
	virtual XUINT32              GetTraceFlags() = 0;
	virtual HRESULT              GetTracingService( XTraceLevel level, XUINT32 suite, ITracingService **ppInterface) = 0;
	virtual HRESULT              GetTracingService( ITracingService **ppInterface) = 0;
	virtual XUINT32              IsTracingServiceEnabled( XTraceLevel level, XUINT32 suite) = 0;
	virtual HRESULT              MediaTraceCreate( IPALReader *pReader, IPALMediaLayerTrace **ppTrace) = 0;
	virtual HRESULT              GetDescriptionForMediaLog( XUINT32 *pBufferLength, XCHAR * pszBuffer) = 0;
	virtual XUINT64              GetMemoryCount() = 0;
	virtual void                 GetTrackerStressFromEnvironment( XUINT32 *pMaxIterations, XUINT32 *pStartIteration) = 0;
	virtual void                 EnableVisualTreeWalk(XUINT32 fEnable) = 0;
	virtual XUINT32              ShouldWalkVisualTree() = 0;
	virtual void                 EnableDirtyFlagsTreeWalk(XUINT32 fEnable) = 0;
	virtual XUINT32              ShouldWalkDirtyFlagsTree() = 0;
	virtual void                 EnableDumpSurface(XUINT32 fEnable) = 0;
	virtual XUINT32              ShouldDumpSurface() = 0;
	virtual void                 DumpSurface(IPALSurface * pSurface) = 0;
	virtual void                 EnableFullscreenPin(XUINT32 fEnable) = 0;
	virtual XUINT32              ShouldPinFullscreen() = 0;
	virtual XUINT32              WaitForManagedDebugger() = 0;
	virtual HRESULT              ShowErrorDialog( const XCHAR * pszTitle, const XCHAR * pszError) = 0;
};